package net.mikoo.seals.biz.service.impl;

import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import net.mikoo.seals.biz.mapper.WechatMapper;
import net.mikoo.seals.biz.service.WechatService;
import net.mikoo.seals.model.WechatUser;

@Service
public class WechatServiceImpl implements WechatService {

	final Logger logger = Logger.getLogger(this.getClass());

	@Autowired
	public WechatMapper wechatMapper;

	@Override
	public WechatUser getUserInfoByUnionId(String unionId) {

		WechatUser wechatUser = wechatMapper.selectUserInfoByUnionId(unionId);

		return wechatUser;
	}

	@Override
	public void save(WechatUser user) {
		wechatMapper.insertUser(user);

	}

	@Override
	public WechatUser getUserInfoByOpenId(String openId) {
		WechatUser wechatUser = wechatMapper.selectUserInfoByOpenId(openId);
		return wechatUser;
	}

}
